import cv2

def face_detect_demo(src):
    gray = cv2.cvtColor(src, cv2.COLOR_BGR2GRAY)
    face_detector = cv2.CascadeClassifier('./haarcascades/haarcascade_frontalface_alt_tree.xml')
    faces = face_detector.detectMultiScale(gray, 1.01, 1)

    for x, y, w, h in faces:
        cv2.rectangle(src, (x, y), (x + w, y + h), (0, 0, 255), thickness=2)
    cv2.imshow('result', src)


img = cv2.imread('assets/img/00.jpg')

face_detect_demo(img)

cv2.waitKey(0)

cv2.destroyAllWindows()